
package com.fire.user.service.impl;

import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.fire.user.dao.SiteMapper;
import com.fire.user.model.SiteModel;
import com.fire.user.service.ISiteService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * 站点Service
 *
 * @author Matthew
 * @Date 2019-01-17 20:50
 */
@Service
public class SiteServiceImpl extends ServiceImpl<SiteMapper, SiteModel> implements ISiteService {

    private static final Logger LOGGER = LoggerFactory.getLogger(SiteServiceImpl.class);

    @Autowired
    private SiteMapper siteMapper;

    @Override
    public SiteModel selectOne(SiteModel entity){
        return siteMapper.selectOne(entity);
    }

    @Override
    public List<SiteModel>selectList(SiteModel model){
        return siteMapper.selectListByModel(model);
    }

    @Override
    public Page<SiteModel> selectPage(int currentPage, int pageSize, Wrapper<SiteModel> wrapper){
        return selectPage(new Page<SiteModel>(currentPage,pageSize), wrapper);
    }

    @Override
    public Page<Map<String, Object>> selectMapsPage(int currentPage, int pageSize, Wrapper<SiteModel> wrapper){
        return selectMapsPage(new Page<SiteModel>(currentPage,pageSize), wrapper);
    }

    /**
     * 查询站点详情
     * @param siteId 站点ID
     * @return
     */
    @Override
    public Map querySiteDetail(String siteId){
        return siteMapper.querySiteDetail(siteId);
    }


}
